import {post,upload} from "./rpc"
const xnService={
    login: (data) => {
        data.method = "xntalk.login";
        return post(data)
    },

    /**
     * 查询产品列表
     * @param data
     * @returns {*}
     */
    findSysProduct: (data) => {
        data.method = "api.master.system.sysProduct.find";
        return post(data)
    },

    /**
     * 通过用户ID获取该用户可以访问的所有功能点
     * @param data
     * @returns {*}
     */
    getAuthList: (data) => {
        data.method = "api.master.system.authList.get";
        return post(data)
    },
    /**

    /**
     * 获取承租人信息和用户id
     * @param data
     * @returns {*}
     */
    getPassport: (data) => {
        data.method = "api.security.passport.get";
        return post(data)
    },
    /**
     * 获取承租人信息
     * @param data
     * @returns {*}
     */
    getUser: (data) => {
        data.method = "api.master.system.user.get";
        return post(data)
    },

    /**
     * 创建提案 二期改动
     * @param data
     * @returns {*}
     */
    apiSuggestCreate: (data) => {
        data.method = "api.suggest.suggest.create";
        return post(data)
    },
    /**
     * 查询提案
     * @param data
     * @returns {*}
     */
    findSuggest: (data) => {
        data.method = "api.suggest.suggest.find";
        return post(data)
    },
    /**
     * 查询提案类型
     * @param data
     * @returns {*}
     */
    findSuggestType: (data) =>{
        data.method = "api.suggest.suggesttype.find";
        return post(data)
    },
    /**
     * 根据id获取提案
     * @param data
     * @returns {*}
     */
    getSuggest: (data) =>{
        data.method = "api.suggest.suggest.get";
        return post(data)
    },
    /**
     * 建议关闭二期改动
     * @param data
     * @returns {*}
     */
    updateToClose: (data) =>{
        data.method = "api.suggest.suggest.toclose.update";
        return post(data)
    },
    /**
     * 重新解决
     * @param data
     * @returns {*}
     */
    updateReopen: (data) =>{
        data.method = "api.suggest.suggest.reopen.update";
        return post(data)
    },
    /**
     * 关闭提案
     * @param data
     * @returns {*}
     */
    updateClose: (data) =>{
        data.method = "api.suggest.suggest.closed.update";
        return post(data)
    },
    /**
     * 完成项目 二期接口改动
     * @param data
     * @returns {*}
     */
    completeProject: (data) =>{
        data.method = "api.suggest.suggest.complete.update";
        return post(data)
    },
    /**
     * 创建评论
     * @param data
     * @returns {*}
     */
    createCommentRecord: (data) =>{
        data.method = "api.suggest.suggest.comment.create";
        return post(data)
    },
    /**
     * 通过业务ID查询评论列表
     * @param data
     * @returns {*}
     */
    getCommentByBusinessId: (data) =>{
        data.method = "api.suggest.suggest.comment.get";
        return post(data)
    },
    /**
     * 编辑提案
     * @param data
     * @returns {*}
     */
    updateSuggest: (data) =>{
        data.method = "api.suggest.suggest.update";
        return post(data)
    },
    /**
     * 分配责任人
     * @param data
     * @returns {*}
     */
    updatePrincipal: (data) =>{
        data.method = "api.suggest.suggest.principal.update";
        return post(data)
    },
    /**
     * 获取提案用户
     * @param data
     * @returns {*}
     */
    getSuggestPerson: (data) =>{
        data.method = "api.suggest.suggestperson.get";
        return post(data)
    },

    /**
     * 获取提案用户
     * @param data
     * @returns {*}
     */
    unionAvatarUpdate: (data) =>{
        data.method = "xntalk.unionAvatar.update";
        return post(data)
    },
    /**
     * 上传图片
     * @param data
     * @returns {*}
     */
    uploadImage: (file, passportId) =>{
        return upload(file,passportId)
    },
    /**
     * 上传图片
     * @param data
     * @returns {*}
     */
    uploadbyfileid: (data) =>{
        data.method = "api.foundation.attachmentByFileId.upload";
        return post(data)
    },
    getNewId: (data) =>{
        data.method = "api.foundation.newId.get";
        return post(data)
    },
    /**
     * 获取所有的责任人
     * @param data
     * @returns {*}
     */
    findSuggestPersonList: (data) =>{
        data.method = "api.suggest.suggest.newsuggestpersonlist.find";
        return post(data)
    },
    /**
     * 获取上传的图片
     * @param data
     * @returns {*}
     */
    getUploadImage: (data) =>{
        data.method = "api.foundation.attachmentsByBizInfo.get";
        return post(data)
    },
    /**
     * 删除上传的图片
     * @param data
     * @returns {*}
     */
    deleteUploadImage: (data) =>{
        data.method = "api.foundation.attachment.delete";
        return post(data)
    },
    /**
     * 更新一批附件的Business编号
     * @param data
     * @returns {*}
     */
    updateAttachmentBusiness: (data) =>{
    data.method = "api.foundation.attachmentByBusinessId.update";
    return post(data)
},
    /**
     * 获取提案类型根节点
     * fangchao
     * @param data
     * @returns {*}
     */
    searchParentSugType: (data) =>{
    data.method = "api.suggest.type.get";
    return post(data)
},
    /**
     * 获取提案类型子节点
     * fangchao
     * @param data
     * @returns {*}
     */
    getSugTypeList: (data) =>{
    data.method = "api.suggesttype.type.get";
    return post(data)
},
    /**
     * 获取业务影响列表dbType=0, 获取项目类型数据dbType=1
     * fangchao
     * @param data
     * @returns {*}
     */
    searchBusinessImpact: (data) =>{
    data.method = "api.business.impact.search";
    return post(data)
},
   /**
     *根据提案ID获取处理人信息
     * fangchao
     * @param data
     * @returns {*}
     */
    getSuggestConfig: (data) =>{
    data.method = "api.suggestconfig.get";
    return post(data)
},

   /**
     *查询项目收益列表
     * fangchao
     * @param data
     * @returns {*}
     */
    searchProjectIncome: (data) =>{
    data.method = "api.project.income.search";
    return post(data)
},
    /**
     *审核
     * fangchao
     * @param data
     * @returns {*}
     */
    isExamineDo: (data) =>{
    data.method = "api.examine.suggest.get";
    return post(data)
},
};
export default xnService;